<template>
  <el-dialog v-model="dialogFormVisible" @close="handleClose"
             :close-on-click-modal="false" :title="title" width="90%" top="20px" :z-index="100000">
    <resource-manage :height="70" @select="handleSelect" :type="type"></resource-manage>
  </el-dialog>
</template>
<script setup>
  const props = defineProps({
    type:{
      type:String,
      default:"checkbox"
    }
  })
  const dialogFormVisible = ref(true)
  const title = ref("资源库")
  // 自定义选择事件
  const emits = defineEmits(["select"])
  // 打开
  const handleOpen = ()=>{
    dialogFormVisible.value = true
  }

  // 关闭
  const handleClose = ()=>{
    dialogFormVisible.value = false
  }

  // 选择文件
  const handleSelect = (file)=>{
    emits("select",file)
  }

  // 暴露方法
  defineExpose({
    handleOpen,
    handleClose
  })

</script>
<style>
</style>